<template>
  <div class="page">
    <van-nav-bar title="设置" left-text="返回" left-arrow @click-left="$router.go(-1)"></van-nav-bar>

    <van-cell-group class="mt-10">
      <van-cell title="账号id" value="888888"></van-cell>
      <van-cell isLink title="登录密码" value="未设置"></van-cell>
      <van-cell isLink title="安全密码" value="未设置"></van-cell>
      <van-cell isLink title="清除缓存" @click="clearData"></van-cell>
    </van-cell-group>

    <!-- 退出登录 -->
    <div class="logout f16 flex fcc bg-fff fixed">
      <!-- <p class="red" @click="logout">退出登录</p> -->
      <p class="red" @click="logout2">退出登录</p>
    </div>
  </div>
</template> 

<script>
import $http from '@/utils/http';
export default {
  methods: {
    logout() {
      $http.post('/user/logout').then(res=> {
        this. store.commit('set_phone','');
        this.$router.push('/my');
      })
    },
    logout2() {
      this.$store.dispatch('LOGOUT');
       this.$router.push('/my');
    },

    clearData() {
      localStorage.clear();
    }
  }
}
</script>

<style lang="less" scoped>
.logout {
  bottom: 0;
  height: 50px;
  color: #c03131;
}
</style>

